import axios from 'axios'
import { Toast } from 'vant'
let service =  axios.create({
	baseURL: '/api',
    timeout:3000
})
/*请求拦截器*/
service.interceptors.request.use(config => {
    Toast.loading({
        type:"loading",
        message:"加载中"
    })
	return config
}, err => {
	return Promise.reject(err)
})
/*响应拦截器*/
service.interceptors.response.use(config => {
    Toast.clear()
	return config
}, err => {
    Toast.clear()
	return Promise.reject(err)
})


export default service